package com.sicnustray.mapper;

import com.sicnustray.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yl
 * @since 2022-11-05
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select id,username,nickname,email,phone,address from user")
    List<User> listUser();

    @Select("select id from user where username=#{username}")
    Integer selectByUser(@Param("username") String username);
    @Select("select * from user where username=#{username}")
    User selectUserByName(@Param("username")String username);
}
